<template>
    <div class="spae_airlistContent" @click.stop>
        <div class="spae_airlistC" id="cityBox15">
            <div class="cityBox_contBox" id="cityCont15">
                <div class="cityBox_contiTtem" v-for="(key,index) in s_list" @click="close(key)">{{key.name}}-{{key.code}}</div>
            </div>
        </div>
    </div>
</template>
<script>
    import scrollBar15 from './../component/scrollBarUltimate.vue'
    export default{
        data(){
            return{
                airData:"",
                scrollNodeX:{
                    parent:"cityBox15",
                    child:"cityCont15",
                    courseN:"course15",
                    sliderN:"slider15",
                    speed:60
                },
                selectData:false
            }
        },
        props:['air'],
        computed:{
            s_list:function () {
                let arr=[];
                let ley=this.air.toUpperCase();
                for(var key in this.airData){
                    for(let i=0;i<this.airData[key].length;i++){
                        if(this.airData[key][i].airportName.toUpperCase().indexOf(ley)!=-1||this.airData[key][i].pinyin.toUpperCase().indexOf(ley)!=-1||this.airData[key][i].py.toUpperCase().indexOf(ley)!=-1||this.airData[key][i].code.toUpperCase().indexOf(ley)!=-1||this.airData[key][i].city.toUpperCase().indexOf(ley)!=-1||this.airData[key][i].citycode.toUpperCase().indexOf(ley)!=-1){
                            arr.push({
                                name:this.airData[key][i].airportName,
                                code:this.airData[key][i].code,
                            });
                            break;
                        }
                    }
                }
                return arr;
            }
        },
        mounted:function () {
            this.airData=JSON.parse(sessionStorage.getItem('airportData'));
        },
        methods:{
            close:function (val) {
                this.$emit('air_interface',val);
            }
        },
        components:{
            scrollBar15:scrollBar15
        }
    }
</script>
<style>

</style>